package com.bp.hearthealth.pulse.lnapps.bp_view

import android.graphics.Outline
import android.os.Build
import android.view.View
import android.view.ViewOutlineProvider
import androidx.annotation.RequiresApi


@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
class BPCircleViewOutlineProvider : ViewOutlineProvider() {
    override fun getOutline(view: View, outline: Outline) {
        //裁剪成一个圆形
        val left0 = (view.width - view.height) / 2
        val top0 = 0
        val right0 = left0 + view.height
        val bottom0 = view.height
        outline.setOval(left0, top0, right0, bottom0)
    }
}